<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"><title>idea多端口实例运行 | Ther的小站</title><meta name="author" content="Ther"><meta name="copyright" content="Ther"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="idea多端口运行是我一直以来的痛，因为idea默认运行实例不支持多端口运行，这也让我踩了很多的坑">
<meta property="og:type" content="article">
<meta property="og:title" content="idea多端口实例运行">
<meta property="og:url" content="http://cjx_0723.gitee.io/2023/05/13/%E5%90%8E%E7%AB%AF/Java%E5%BC%80%E5%8F%91/idea%E5%A4%9A%E7%AB%AF%E5%8F%A3%E5%AE%9E%E4%BE%8B%E8%BF%90%E8%A1%8C/index.html">
<meta property="og:site_name" content="Ther的小站">
<meta property="og:description" content="idea多端口运行是我一直以来的痛，因为idea默认运行实例不支持多端口运行，这也让我踩了很多的坑">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://w.wallhaven.cc/full/1p/wallhaven-1ppld1.jpg">
<meta property="article:published_time" content="2023-05-13T14:06:41.536Z">
<meta property="article:modified_time" content="2023-05-13T14:12:50.112Z">
<meta property="article:author" content="Ther">
<meta property="article:tag" content="Java开发">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://w.wallhaven.cc/full/1p/wallhaven-1ppld1.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="http://cjx_0723.gitee.io/2023/05/13/%E5%90%8E%E7%AB%AF/Java%E5%BC%80%E5%8F%91/idea%E5%A4%9A%E7%AB%AF%E5%8F%A3%E5%AE%9E%E4%BE%8B%E8%BF%90%E8%A1%8C/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><meta/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: {"appId":"YGMR4LH4DH","apiKey":"1fb48f3686d76eaf600890b7d3bb69c9","indexName":"index_hexo","hits":{"per_page":10},"languages":{"input_placeholder":"搜索文章","hits_empty":"找不到您查询的内容：${query}","hits_stats":"找到 ${hits} 条结果，用时 ${time} 毫秒"}},
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#2d3035","position":"bottom-left"},
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  }
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'idea多端口实例运行',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-05-13 22:12:50'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"><link rel="alternate" href="/atom.xml" title="Ther的小站" type="application/atom+xml">
</head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">31</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">21</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">7</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-heartbeat"></i><span> 清单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/Gallery/"><i class="fa-fw fas fa-images"></i><span> 照片</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://w.wallhaven.cc/full/1p/wallhaven-1ppld1.jpg')"><nav id="nav"><span id="blog-info"><a href="/" title="Ther的小站"><span class="site-name">Ther的小站</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-heartbeat"></i><span> 清单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/Gallery/"><i class="fa-fw fas fa-images"></i><span> 照片</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">idea多端口实例运行</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-05-13T14:06:41.536Z" title="发表于 2023-05-13 22:06:41">2023-05-13</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-05-13T14:12:50.112Z" title="更新于 2023-05-13 22:12:50">2023-05-13</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E5%90%8E%E7%AB%AF/">后端</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">570</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>1分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="idea多端口实例运行"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><meta name="referrer" content="no-referrer"/>

<h2 id="1-问题场景"><a href="#1-问题场景" class="headerlink" title="1 问题场景"></a>1 问题场景</h2><p>我们在进行新项目开发的时候， 可能做完一个新的模块功能并自测通过之后， 我们希望测试人员能帮我跑一些<a target="_blank" rel="noopener" href="https://so.csdn.net/so/search?q=%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%94%A8%E4%BE%8B&spm=1001.2101.3001.7020">单元测试用例</a>来进行测试验证， 但是我们又需要在此基础上技术开发新的功能， 这是我们就需要在我们的开发PC上同时运行多实例来保证开发及内部测试的需求，下面就说说怎么在IDEA上实现这个同项目多实例运行</p>
<h2 id="2-环境准备"><a href="#2-环境准备" class="headerlink" title="2 环境准备"></a>2 环境准备</h2><ul>
<li>JDK 1.8</li>
<li>IDEA 2021.3.2</li>
</ul>
<h2 id="3-配置过程"><a href="#3-配置过程" class="headerlink" title="3 配置过程"></a>3 配置过程</h2><h3 id="3-1-运行实例配置"><a href="#3-1-运行实例配置" class="headerlink" title="3.1 运行实例配置"></a>3.1 运行实例配置</h3><p>修改当前项目的启动配置<br><img src="https://img-blog.csdnimg.cn/2c206beeb9a44f95a9159e5f1ae67b8e.png" alt="在这里插入图片描述"><br>设置项目实例名称<br><img src="https://img-blog.csdnimg.cn/cdb0b9b98b43415ba841a5bf38c8816b.png" alt="在这里插入图片描述"><br>开启多实例配置<br><img src="https://img-blog.csdnimg.cn/98db3121e54440b383f9df973682d003.png" alt="在这里插入图片描述"><br>设置当前实例的运行端口<br><img src="https://img-blog.csdnimg.cn/bca5caab4cfe4d86a354c33cc1b02996.png" alt="在这里插入图片描述"><br>复制当前实例<br><img src="https://img-blog.csdnimg.cn/aea48a907e0a49e8abc0a82126a36219.png" alt="在这里插入图片描述"><br>修改复制实例的名称及运行端口<br><img src="https://img-blog.csdnimg.cn/1b1b263407824ff2a74c0584aec05e50.png" alt="在这里插入图片描述"></p>
<h3 id="3-2-设置运行组"><a href="#3-2-设置运行组" class="headerlink" title="3.2 设置运行组"></a>3.2 设置运行组</h3><p>新建一个运行组<br><img src="https://img-blog.csdnimg.cn/3ee472dd63014acc9fc2e59cc37753aa.png" alt="在这里插入图片描述"><br><img src="https://img-blog.csdnimg.cn/674cbd4e2a7144bb9345bfdb289b8447.png" alt="在这里插入图片描述"><br>修改运行组名称和运行组中的启动实例<br><img src="https://img-blog.csdnimg.cn/083c2929546a43619890167c0f0acbd1.png" alt="在这里插入图片描述"></p>
<h3 id="3-3-运行组启动测试"><a href="#3-3-运行组启动测试" class="headerlink" title="3.3 运行组启动测试"></a>3.3 运行组启动测试</h3><p>通过以上操作，基本就配置好了， 这里我们来运行一下， 看看两个服务是否都可以正常运行起来。<br><img src="https://img-blog.csdnimg.cn/f173f2643dba42e9b4b8892915105a42.png" alt="在这里插入图片描述"><br>AppRun-8009成功启动<br><img src="https://img-blog.csdnimg.cn/11c9748207c843dd955e8f670ca2cbab.png" alt="在这里插入图片描述"><br>AppRun-8010成功启动<br><img src="https://img-blog.csdnimg.cn/594e0c15c25141a8bd51fed0f7c11175.png" alt="在这里插入图片描述"></p>
<p>OK, 配置结束， 之后让测试在8010端口进行测试， 我们可以在8009端口继续进行新的业务模块功能开发，匹配不会互相影响。当然正常的我们应该打包到测试环境提供一个稳定的环境让测试人员进行测试，咱们这只是内部转测试，还没到集成阶段， 只是能尽早让测试人员介入到项目中的一种解决方案，每个公司可能对于<a target="_blank" rel="noopener" href="https://so.csdn.net/so/search?q=%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86&spm=1001.2101.3001.7020">项目管理</a>的要求都不一样，根据实际情况调整处理就好了。</p>
<h2 id="4-多环境运行配置"><a href="#4-多环境运行配置" class="headerlink" title="4 多环境运行配置"></a>4 多环境运行配置</h2><p>在项目开发中，难免会遇上需要配置多个运行环境，例如开发环境、测试环境、上线环境等等，如果需要IDEA能够在不同端口运行不同的环境，则需要进行以下配置，这里我的环境：</p>
<p><img src="https://typora-md-bucket.oss-cn-beijing.aliyuncs.com/image-20230513221053596.png" alt="image-20230513221053596"></p>
<p>在运行实例配置中，只需要指定该实例所运行的环境即可：</p>
<p><img src="https://typora-md-bucket.oss-cn-beijing.aliyuncs.com/image-20230513221202978.png" alt="image-20230513221202978"></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="http://cjx_0723.gitee.io">Ther</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://cjx_0723.gitee.io/2023/05/13/%E5%90%8E%E7%AB%AF/Java%E5%BC%80%E5%8F%91/idea%E5%A4%9A%E7%AB%AF%E5%8F%A3%E5%AE%9E%E4%BE%8B%E8%BF%90%E8%A1%8C/">http://cjx_0723.gitee.io/2023/05/13/%E5%90%8E%E7%AB%AF/Java%E5%BC%80%E5%8F%91/idea%E5%A4%9A%E7%AB%AF%E5%8F%A3%E5%AE%9E%E4%BE%8B%E8%BF%90%E8%A1%8C/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://cjx_0723.gitee.io" target="_blank">Ther的小站</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Java%E5%BC%80%E5%8F%91/">Java开发</a></div><div class="post_share"><div class="social-share" data-image="https://w.wallhaven.cc/full/1p/wallhaven-1ppld1.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2023/05/15/%E4%B8%AD%E9%97%B4%E4%BB%B6/mysql/MySQL%E6%95%99%E7%A8%8B%EF%BC%88%E4%BA%8C%EF%BC%89%E2%80%94%E2%80%94%20%E6%A6%82%E8%BF%B0%E5%92%8CSQL%E8%AF%AD%E6%B3%95/" title="MySQL教程（二）—— 概述和SQL语法"><img class="cover" src="https://img1.baidu.com/it/u=950222251,316656728&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPG?w=967&amp;h=500" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">MySQL教程（二）—— 概述和SQL语法</div></div></a></div><div class="next-post pull-right"><a href="/2023/05/13/%E5%89%8D%E7%AB%AF%E5%BC%80%E5%8F%91/Vue%20%E5%A4%9A%E7%8E%AF%E5%A2%83%E7%9A%84%E9%85%8D%E7%BD%AE/" title="Vue 多环境的配置"><img class="cover" src="https://w.wallhaven.cc/full/m3/wallhaven-m3zjx1.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Vue 多环境的配置</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2023/05/12/%E5%90%8E%E7%AB%AF/Java%E5%BC%80%E5%8F%91/SpringBoot%E5%8F%82%E6%95%B0%E6%8E%A5%E6%94%B6/" title="SpringBoot参数接收"><img class="cover" src="https://w.wallhaven.cc/full/1p/wallhaven-1pd1o9.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2023-05-12</div><div class="title">SpringBoot参数接收</div></div></a></div><div><a href="/2023/04/26/%E5%90%8E%E7%AB%AF/Java%E5%BC%80%E5%8F%91/Java%E5%BC%80%E5%8F%91%E5%B8%B8%E7%94%A8%E5%B7%A5%E5%85%B7%E7%B1%BB%E6%B1%87%E6%80%BB/" title="Java开发常用工具类汇总"><img class="cover" src="https://w.wallhaven.cc/full/1p/wallhaven-1pd1o9.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2023-04-26</div><div class="title">Java开发常用工具类汇总</div></div></a></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Ther</div><div class="author-info__description"></div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">31</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">21</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">7</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-%E9%97%AE%E9%A2%98%E5%9C%BA%E6%99%AF"><span class="toc-text">1 问题场景</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87"><span class="toc-text">2 环境准备</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-%E9%85%8D%E7%BD%AE%E8%BF%87%E7%A8%8B"><span class="toc-text">3 配置过程</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#3-1-%E8%BF%90%E8%A1%8C%E5%AE%9E%E4%BE%8B%E9%85%8D%E7%BD%AE"><span class="toc-text">3.1 运行实例配置</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-2-%E8%AE%BE%E7%BD%AE%E8%BF%90%E8%A1%8C%E7%BB%84"><span class="toc-text">3.2 设置运行组</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-3-%E8%BF%90%E8%A1%8C%E7%BB%84%E5%90%AF%E5%8A%A8%E6%B5%8B%E8%AF%95"><span class="toc-text">3.3 运行组启动测试</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#4-%E5%A4%9A%E7%8E%AF%E5%A2%83%E8%BF%90%E8%A1%8C%E9%85%8D%E7%BD%AE"><span class="toc-text">4 多环境运行配置</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2023/09/06/%E7%94%9F%E6%B4%BB/%E5%AD%A6%E6%A0%A1/%E7%A0%94%E4%B8%80%E9%80%89%E8%AF%BE/" title="研一选课"><img src="https://w.wallhaven.cc/full/4g/wallhaven-4gwl6q.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="研一选课"/></a><div class="content"><a class="title" href="/2023/09/06/%E7%94%9F%E6%B4%BB/%E5%AD%A6%E6%A0%A1/%E7%A0%94%E4%B8%80%E9%80%89%E8%AF%BE/" title="研一选课">研一选课</a><time datetime="2023-09-06T07:55:08.667Z" title="发表于 2023-09-06 15:55:08">2023-09-06</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/26/%E5%90%8E%E7%AB%AF/%E5%88%86%E5%B8%83%E5%BC%8F%E7%B3%BB%E7%BB%9F/MIT-6.824-%E5%88%86%E5%B8%83%E5%BC%8F%E7%B3%BB%E7%BB%9F%E8%AF%BE%E7%A8%8B%E7%AC%94%E8%AE%B0/" title="MIT-6.824-分布式系统课程笔记">MIT-6.824-分布式系统课程笔记</a><time datetime="2023-07-26T02:09:02.000Z" title="发表于 2023-07-26 10:09:02">2023-07-26</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/05/17/%E4%B8%AD%E9%97%B4%E4%BB%B6/mysql/MySQL%E6%95%99%E7%A8%8B%EF%BC%88%E4%B8%89%EF%BC%89%E2%80%94%E2%80%94%20MySQL%E9%AB%98%E7%BA%A7/" title="MySQL教程（三）—— MySQL高级"><img src="https://img1.baidu.com/it/u=950222251,316656728&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPG?w=967&amp;h=500" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="MySQL教程（三）—— MySQL高级"/></a><div class="content"><a class="title" href="/2023/05/17/%E4%B8%AD%E9%97%B4%E4%BB%B6/mysql/MySQL%E6%95%99%E7%A8%8B%EF%BC%88%E4%B8%89%EF%BC%89%E2%80%94%E2%80%94%20MySQL%E9%AB%98%E7%BA%A7/" title="MySQL教程（三）—— MySQL高级">MySQL教程（三）—— MySQL高级</a><time datetime="2023-05-17T12:12:30.479Z" title="发表于 2023-05-17 20:12:30">2023-05-17</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/05/17/%E5%89%8D%E6%B2%BF%E6%8A%80%E6%9C%AF/%E5%8C%BA%E5%9D%97%E9%93%BE/%E6%AF%95%E8%AE%BE/" title="区块链毕设">区块链毕设</a><time datetime="2023-05-17T08:40:58.540Z" title="发表于 2023-05-17 16:40:58">2023-05-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/05/15/%E4%B8%AD%E9%97%B4%E4%BB%B6/ElasticSearch/Linux%E7%B3%BB%E7%BB%9F%E4%B8%AD%E5%AE%89%E8%A3%85Elasticsearch%E5%B9%B6%E5%AE%9E%E7%8E%B0%E5%BC%80%E6%9C%BA%E8%87%AA%E5%8A%A8%E5%90%AF%E5%8A%A8/" title="Linux系统中安装Elasticsearch并实现开机自动启动"><img src="https://img1.baidu.com/it/u=950222251,316656728&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPG?w=967&amp;h=500" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Linux系统中安装Elasticsearch并实现开机自动启动"/></a><div class="content"><a class="title" href="/2023/05/15/%E4%B8%AD%E9%97%B4%E4%BB%B6/ElasticSearch/Linux%E7%B3%BB%E7%BB%9F%E4%B8%AD%E5%AE%89%E8%A3%85Elasticsearch%E5%B9%B6%E5%AE%9E%E7%8E%B0%E5%BC%80%E6%9C%BA%E8%87%AA%E5%8A%A8%E5%90%AF%E5%8A%A8/" title="Linux系统中安装Elasticsearch并实现开机自动启动">Linux系统中安装Elasticsearch并实现开机自动启动</a><time datetime="2023-05-15T08:26:31.492Z" title="发表于 2023-05-15 16:26:31">2023-05-15</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By Ther</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><div class="js-pjax"><script>if (!window.MathJax) {
  window.MathJax = {
    tex: {
      inlineMath: [ ['$','$'], ["\\(","\\)"]],
      tags: 'ams'
    },
    chtml: {
      scale: 1.1
    },
    options: {
      renderActions: {
        findScript: [10, doc => {
          for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
            const display = !!node.type.match(/; *mode=display/)
            const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display)
            const text = document.createTextNode('')
            node.parentNode.replaceChild(text, node)
            math.start = {node: text, delim: '', n: 0}
            math.end = {node: text, delim: '', n: 0}
            doc.math.push(math)
          }
        }, ''],
        insertScript: [200, () => {
          document.querySelectorAll('mjx-container').forEach(node => {
            if (node.hasAttribute('display')) {
              btf.wrap(node, 'div', { class: 'mathjax-overflow' })
            } else {
              btf.wrap(node, 'span', { class: 'mathjax-overflow' })
            }
          });
        }, '', false]
      }
    }
  }
  
  const script = document.createElement('script')
  script.src = 'https://cdn.jsdelivr.net/npm/mathjax/es5/tex-mml-chtml.min.js'
  script.id = 'MathJax-script'
  script.async = true
  document.head.appendChild(script)
} else {
  MathJax.startup.document.state(0)
  MathJax.texReset()
  MathJax.typesetPromise()
}</script></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><div id="algolia-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="search-wrap"><div id="algolia-search-input"></div><hr/><div id="algolia-search-results"><div id="algolia-hits"></div><div id="algolia-pagination"></div><div id="algolia-info"><div class="algolia-stats"></div><div class="algolia-poweredBy"></div></div></div></div></div><div id="search-mask"></div><script src="https://cdn.jsdelivr.net/npm/algoliasearch/dist/algoliasearch-lite.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instantsearch.js/dist/instantsearch.production.min.js"></script><script src="/js/search/algolia.js"></script></div></body></html>